package com.aaa.entity;


import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 商品表
 * @TableName g_goods
 */
@TableName(value ="g_goods")
@Data
public class GGoods implements Serializable {
    /**
     * 商品主键

     */
    @TableId
    private Integer id;

    /**
     * 商品名称
     */
    private String gname;

    /**
     * 商品图片
     */
    private String img;

    /**
     * 商品描述
     */
    private String remark;

    /**
     * 商品品牌
     */
    private Integer brandid;

    /**
     * 商品类别
     */
    private Integer sortid;

    /**
     * 储藏方式
     */
    private Integer depositid;

    /**
     * 商品单位
     */
    private Integer unitid;

    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date addtime;

    /**
     * 保质期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date expirationtime;

    /**
     * 商品状态0审核通过 1驳回 2待审核
     */
    private Integer state;

    /**
     * 上下架 0上架 1下架
     */
    private Integer status;

    /**
     * 商家id
     */
    private String bid;

    /**
     * 价格
     */
    private String price;

    /**
     * 逻辑删除
     */
    private Integer isdeleted;

    /**
     * 驳回理由
     */
    private String checkContent;

    @TableField(exist = false)
    private Integer totalnum;

    @TableField(exist = false)
    private String sname;

    @TableField(exist = false)
    private String brandname;

    @TableField(exist = false)
    private String sortname;

    @TableField(exist = false)
    private String depositname;

    @TableField(exist = false)
    private String unitname;

    @TableField(exist = false)
    private  GSort gSort;

    @TableField(exist = false)
    private OStock oStock;

    @TableField(exist = false)
    private GUnit unit;

    @TableField(exist = false)
    private GBrand gBrand;

    @TableField(exist = false)
    private GDeposit gDeposit;

    @TableField(exist = false)
    private GGoods gGoods;




    public GGoods getgGoods() {
        return gGoods;
    }

    public void setgGoods(GGoods gGoods) {
        this.gGoods = gGoods;
    }

    @TableField(exist = false)
    private BBusinessInfo businessInfo;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public GSort getgSort() {
        return gSort;
    }

    public void setgSort(GSort gSort) {
        this.gSort = gSort;
    }

    public OStock getoStock() {
        return oStock;
    }

    public void setoStock(OStock oStock) {
        this.oStock = oStock;
    }

    public GUnit getUnit() {
        return unit;
    }

    public void setUnit(GUnit gUnit) {
        this.unit = gUnit;
    }

    public GBrand getgBrand() {
        return gBrand;
    }

    public void setgBrand(GBrand gBrand) {
        this.gBrand = gBrand;
    }

    public GDeposit getgDeposit() {
        return gDeposit;
    }

    public void setgDeposit(GDeposit gDeposit) {
        this.gDeposit = gDeposit;
    }

    public BBusinessInfo getBusinessInfo() {
        return businessInfo;
    }

    public void setBusinessInfo(BBusinessInfo bBusinessInfo) {
        this.businessInfo = bBusinessInfo;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;






    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GGoods other = (GGoods) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGname() == null ? other.getGname() == null : this.getGname().equals(other.getGname()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getBrandid() == null ? other.getBrandid() == null : this.getBrandid().equals(other.getBrandid()))
            && (this.getSortid() == null ? other.getSortid() == null : this.getSortid().equals(other.getSortid()))
            && (this.getDepositid() == null ? other.getDepositid() == null : this.getDepositid().equals(other.getDepositid()))
            && (this.getUnitid() == null ? other.getUnitid() == null : this.getUnitid().equals(other.getUnitid()))
            && (this.getAddtime() == null ? other.getAddtime() == null : this.getAddtime().equals(other.getAddtime()))
            && (this.getExpirationtime() == null ? other.getExpirationtime() == null : this.getExpirationtime().equals(other.getExpirationtime()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getBid() == null ? other.getBid() == null : this.getBid().equals(other.getBid()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getIsdeleted() == null ? other.getIsdeleted() == null : this.getIsdeleted().equals(other.getIsdeleted()))
            && (this.getCheckContent() == null ? other.getCheckContent() == null : this.getCheckContent().equals(other.getCheckContent()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGname() == null) ? 0 : getGname().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getBrandid() == null) ? 0 : getBrandid().hashCode());
        result = prime * result + ((getSortid() == null) ? 0 : getSortid().hashCode());
        result = prime * result + ((getDepositid() == null) ? 0 : getDepositid().hashCode());
        result = prime * result + ((getUnitid() == null) ? 0 : getUnitid().hashCode());
        result = prime * result + ((getAddtime() == null) ? 0 : getAddtime().hashCode());
        result = prime * result + ((getExpirationtime() == null) ? 0 : getExpirationtime().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getBid() == null) ? 0 : getBid().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getIsdeleted() == null) ? 0 : getIsdeleted().hashCode());
        result = prime * result + ((getCheckContent() == null) ? 0 : getCheckContent().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", gname=").append(gname);
        sb.append(", img=").append(img);
        sb.append(", remark=").append(remark);
        sb.append(", brandid=").append(brandid);
        sb.append(", sortid=").append(sortid);
        sb.append(", depositid=").append(depositid);
        sb.append(", unitid=").append(unitid);
        sb.append(", addtime=").append(addtime);
        sb.append(", expirationtime=").append(expirationtime);
        sb.append(", state=").append(state);
        sb.append(", status=").append(status);
        sb.append(", bid=").append(bid);
        sb.append(", price=").append(price);
        sb.append(", isdeleted=").append(isdeleted);
        sb.append(", checkContent=").append(checkContent);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}